home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / phit.swf / scripts / __Packages / CPhitMenu.as < prev    next >
Encoding:
Text File  |  2007-07-13  |  1.7 KB  |  67 lines

  1. class CPhitMenu extends CMovieClipFresh
  2. {
  3.    var _buttonBegin;
  4.    var _buttonPickLevel;
  5.    var _buttonResume;
  6.    var _buttonArmor;
  7.    function CPhitMenu()
  8.    {
  9.       super();
  10.       _root._mainMenu = this;
  11.       this.gotoAndPlay("appear");
  12.    }
  13.    function FirstFrameInitialize()
  14.    {
  15.       this._buttonBegin.Initialize("Begin!",this.OnBegin);
  16.       this._buttonPickLevel.Initialize("More Games...",this.OnMoreGames);
  17.       this._buttonResume.Initialize("Skip to level...",this.OnPick);
  18.       var _loc3_ = CPhitPresentation(_root._presentation).GetLastPlayedLevel();
  19.       if(_loc3_ != undefined)
  20.       {
  21.          this._buttonArmor.Initialize("Resume level " + (_loc3_ + 1),this.OnResume);
  22.       }
  23.       else
  24.       {
  25.          this._buttonArmor.SetEnabled(false);
  26.       }
  27.    }
  28.    function FixupButtons()
  29.    {
  30.       this.FirstFrameInitialize();
  31.    }
  32.    function OnAppearDone()
  33.    {
  34.       this.stop();
  35.    }
  36.    function OnMoreGames()
  37.    {
  38.       FreshDebug.Trace("CPhitMenu.OnMoreGames");
  39.       _root.getURL("http://www.armorgames.com/","_blank");
  40.    }
  41.    function OnBegin()
  42.    {
  43.       FreshDebug.Trace("CPhitMenu.OnBegin");
  44.       _root._iStartLevel = 0;
  45.       _root._mainMenu.gotoAndPlay("dismiss");
  46.    }
  47.    function OnDismissDone()
  48.    {
  49.       _root._presentation.gotoAndStop("play");
  50.    }
  51.    function OnPick()
  52.    {
  53.       FreshDebug.Trace("CPhitMenu.OnPick");
  54.       _root._mainMenu.gotoAndPlay("to pick level");
  55.    }
  56.    function OnToPickTransitionDone()
  57.    {
  58.       this.stop();
  59.    }
  60.    function OnResume()
  61.    {
  62.       FreshDebug.Trace("CPhitMenu.OnResume");
  63.       _root._iStartLevel = CPhitPresentation(_root._presentation).GetLastPlayedLevel();
  64.       _root._mainMenu.gotoAndPlay("dismiss");
  65.    }
  66. }
  67.